﻿using FreeSql.DataAnnotations;
using FYSJcrm.Core.Model.PermManage;
using System;

namespace FYSJcrm.Core.Model.SystemManage
{
    [Table(Name = "FYSJ_SystemLog")]
    public class SystemLogEntity : BaseEntity
    {
        /// <summary>
        /// 用户Id
        /// </summary>
        public int UserId { get; set; }

        /// <summary>
        /// 日志内容
        /// </summary>
        [Column(StringLength = 255, IsNullable = false)]
        public string Message { get; set; }

        /// <summary>
        /// 用户登陆IP
        /// </summary>
        [Column(StringLength = 50, IsNullable = false)]
        public string LoginIP { get; set; }

        /// <summary>
        /// 添加时间
        /// </summary>
        public DateTime AddTime { get; set; } = DateTime.Now;

        /// <summary>
        /// 管理员，多个日志可对应一个管理员
        /// </summary>
        [Navigate(nameof(Id))]
        public virtual ManagerEntity Manager { get; set; }
    }
}
